<%@taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix = "fmt" uri = "http://java.sun.com/jsp/jstl/fmt"%>

<h2><fmt:message key = "form.addRequest"/></h2>

<div class = "messages"><jsp:include page = "/messages.jsp"/></div>

<div id="box">
<form action = "clientui" method = "post" name = "requestAddForm">
   <table class = "form">
      <tr>
         <td class = "label"><fmt:message key = "request.regNumber"/></td>
         <td>
            <input type="text" name="regNumber" maxlength="50" value='<c:out value = "${param['regNumber']}"/>'/>
         </td>
      </tr>
        
      <tr>
         <td class = "label"><fmt:message key = "request.department"/><span class="star">*</span></td>
         <td>
            <select id="departmentsList" name="department_id">
              <option value="0"><fmt:message key = "request.selectDepartment"/></option>
              <c:forEach var = "department" items = "${departmentsList}">
                <option value="${department.id}" ${department.id == param["department_id"] ? "selected" : ""}>
                   <c:out value="${department.name}"/>
                </option>
              </c:forEach>
            </select>            
            <span class="error"><c:out value="${error.department}"/></span>
         </td>
      </tr>           
      
      <tr>
         <td class = "label"><fmt:message key = "request.room"/></td>
         <td>
            <input type="text" name="room" maxlength="50" value='<c:out value = "${param['room']}"/>'/>
         </td>
      </tr>
      
      <tr>
         <td class = "label"><fmt:message key = "request.text"/><span class="star">*</span></td>
         <td>
            <textarea name = "text" rows="10" cols="50"><c:out value = "${param['text']}"/></textarea>
            <span class="error"><c:out value="${error.clientText}"/></span>
         </td>
      </tr>                         
</table>

<input name = "_action" type = "hidden"/>
</form>

</div>

<p><span class="small"><fmt:message key = "requiredfields"/></span></p>
     
<div class="links">
<ul class = "navbar2">
  <li><a href = 'javascript:doAction("processRequestForm");'><fmt:message key = "Command.add"/></a></li> 
  <li><a href = "clientui?_action=listRequests"><fmt:message key = "Command.RequestList"/></a></li> 
</ul>
</div>